package com.cn.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RefreshScope
public class UserController {

    @Value("${server.port}")
    private String port;

    @Value("${pattern.dateformat}")
    private String dateformat;

    @GetMapping("/userId/{id}")
    public String userId(@PathVariable String id){
        System.out.println(id);
        System.out.println(port);
        return port;
    }

    @GetMapping("/now")
    public String now(){
        return dateformat;
    }


}
